#define  _CRT_SECURE_NO_WARNINGS 1
#include "List.h"

void Test1()
{
	ListNode* phead = ListInit();
	ListPushBack(phead, 1);
	ListPushBack(phead, 2);
	ListPushBack(phead, 3);
	ListPushBack(phead, 4);
	ListPrint(phead);

	ListPushFront(phead, 0);
	ListPushFront(phead, -1);
	ListPushFront(phead, -10);
	ListPrint(phead);

	ListDestroy(phead);
	phead = NULL;
}


void Test2()
{
	ListNode* phead = ListInit();
	ListPushBack(phead, 1);
	ListPushBack(phead, 2);
	ListPushBack(phead, 3);
	ListPushBack(phead, 4);
	ListPrint(phead);

	ListNode* pos = ListFind(phead, 1);
	if (pos)
	{
		ListInsert(pos, 10);
	}
	ListPrint(phead);

	pos = ListFind(phead, 1);
	if (pos)
	{
		ListErase(pos);
	}
	ListPrint(phead);

	ListDestroy(phead);
	phead = NULL;
}

int main()
{
	Test2();
	return 0;
}